]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
baseAppView: Move _loadGrid() into _redisplay()
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 2 Jul 2019 02:01:59 +0000 (23:01 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Tue, 6 Aug 2019 00:19:26 +0000 (21:19 -0300)
Next commit will introduce differential loading of
app icons, and will reorganize this part of the
codebase.

When doing that, the ideal symmetry of the new code
would be:

 * Update BaseAppView._allItems array
 * Update BaseAppView._items map
 * Update BaseAppView._grid actor

Move the code in _loadGrid() into _redisplay() so that
we can check in-place which new icons need to be added.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/645

js/ui/appDisplay.js

index c235f87f8096bba01ad9e69e7422128f66ca9f6b..b253fdb216bcc61fc2b346d389de82cab1093626 100644 (file)
@@ -123,7 +123,10 @@ class BaseAppView {
     _redisplay() {
         this.removeAll();
         this._loadApps();
-        this._loadGrid();
+
+        this._allItems.sort(this._compareItems);
+        this._allItems.forEach(item => this._grid.addItem(item));
+        this.emit('view-loaded');
     }
 
     getAllItems() {
@@ -147,12 +150,6 @@ class BaseAppView {
         return a.name.localeCompare(b.name);
     }
 
-    _loadGrid() {
-        this._allItems.sort(this._compareItems);
-        this._allItems.forEach(item => this._grid.addItem(item));
-        this.emit('view-loaded');
-    }
-
     _selectAppInternal(id) {
         if (this._items[id])
             this._items[id].actor.navigate_focus(null, St.DirectionType.TAB_FORWARD, false);
@@ -338,6 +335,7 @@ var AllView = class AllView extends BaseAppView {
             openFolderId = this._currentPopup._source.id;
 
         super._redisplay();
+        this._refilterApps();
 
         if (openFolderId) {
             let [folderToReopen] = this.folderIcons.filter(folder => folder.id == openFolderId);
@@ -420,11 +418,6 @@ var AllView = class AllView extends BaseAppView {
         });
     }
 
-    _loadGrid() {
-        super._loadGrid();
-        this._refilterApps();
-    }
-
     // Overridden from BaseAppView
     animate(animationDirection, onComplete) {
         this._scrollView.reactive = false;